#!/usr/bin/python3
# -*- coding:utf-8 -*-
""""
   @Author: 即将拥有人鱼线的yjw
   @Time: 2024/12/6 11:16
   @File: productClient.py
   @desc:
"""
from faker import Faker
from DataTest.tabledata.commonData import randomInfo
from DataTest.tabledata.commonData.agencyClient import random_client

fake = Faker(locale='zh_CN')

def get_product_client():
    '''
       客户名称、
       住所、
       经营范围、
       组织机构代码、
       税务登记证号码；
       可证明该客户依法设立或者可依法开展经营、社会活动的执照、证件或者文件的名称、
       号码和
       有效期限；
       控股股东或者实际控制人、
       法定代表人、
       负责人和授权办理业务人员的姓名、
       身份证件或者身份证明文件的种类、
       号码、
       有效期限。
       :return:
       '''
    name = fake.company()
    phone = fake.phone_number()
    addList = fake.address().split(' ')
    transactor_person = random_client()  # 经办人
    actual_person = random_client()  # 实际控制人
    ctrl_person = random_client()  # 控股股东
    legp_person = random_client()  # 法人
    benefit_person = random_client()  # 受益所有人
    manager_person = random_client() #资产管理人
    dict_entries = {
        'client_name': name,
        'client_full_name': name,
        'client_type': '2',
        'nationality_code': 'CHN',
        'gender_code': '',
        'education_code': '',
        'id_no': randomInfo.random_credit_code(),
        'birth_date': 0,
        'id_type': '24',
        'id_address': fake.address().split(' ')[0],
        'contact_address': addList[0],
        'email_address': addList[0],
        'work_unit_address': addList[0],
        'zip_code': addList[1],
        'cellphone_number': phone,
        'telephone_number': phone,
        'register_capital': randomInfo.get_random_int(8),  # 注册资本
        'register_country_code': 'CHN',  # 注册国家
        'register_capital_currency':'CNY',#注册资金币种代码CNY、USD、HKD
        'register_address':'开曼群岛',#注册地址
        'occupation_code': 'J0000',  # 行业,默认金融业
        'business_scope': '金融、投资',#经营范围
        'business_country_code':'CHN',#经营所在地国家
        'institution_type': '0',  # 机构类型B0182
        'id_end_date': randomInfo.get_overdue_date(),
        'transactor_name': transactor_person['name'],
        'transactor_id_type': transactor_person['id_type'],
        'transactor_id_no': transactor_person['id_no'],
        'transactor_id_end_date': transactor_person['id_end_date'],
        'transactor_nationality_code': 'CHN',
        'actual_control_name': actual_person['name'],
        'actual_control_id_type': actual_person['id_type'],
        'actual_control_id_no': actual_person['id_no'],
        'actual_control_id_end_date': actual_person['id_end_date'],
        'ctrl_shareholder_name': ctrl_person['name'],
        'ctrl_shareholder_id_no': ctrl_person['id_no'],
        'ctrl_shareholder_id_type': ctrl_person['id_type'],
        'ctrl_shareholder_type': '',
        'ctrl_shareholder_id_end_date': ctrl_person['id_end_date'],
        'legp_name': legp_person['name'],
        'legp_id_type': legp_person['id_type'],
        'legp_id_no': legp_person['id_no'],
        'legp_id_end_date': legp_person['id_end_date'],
        'benefit_name': benefit_person['name'],
        'benefit_id_type': benefit_person['id_type'],
        'benefit_id_no': benefit_person['id_no'],
        'benefit_id_end_date': benefit_person['id_end_date'],
        'benefit_id': '',
        'manager_name': manager_person['name'],
        'manger_id_no': manager_person['id_no'],
        'manager_id_type': manager_person['id_type'],
        'assert_manager_id_end_date': manager_person['id_end_date'],
        'bank_name': name
    }
    print(dict_entries)
    return dict_entries

if __name__=='__main__':
    get_product_client()